#include<bits/stdc++.h>
using namespace std;
int a[100005],n,ans;
inline int read()
{
    char c=getchar();
    while(c<'0'||c>'9')
    c=getchar();
    int ret=0;
    while(c>='0'&&c<='9')
    {
        ret=(ret<<1)+(ret<<3)+c-48;
        c=getchar();
    }
    return ret;
}
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    n=read();
    for(int i=1;i<=n;i++)
    a[i]=read();
    sort(a+1,a+n+1);
    int x=upper_bound(a+1,a+n+1,a[1])-a;
    for(int i=1;i<=n;i++)
    {
        if(x>n)
        break;
        if(a[x]<=a[i])
        x=upper_bound(a+1,a+n+1,a[i])-a;
        if(x>n)
        break;
        ans++;
        x++;
    }
    printf("%d",n-ans);
    return 0;
}
